package com.evildog.workspace.system.application.convert;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.evildog.workspace.common.result.PagedResult;
import com.evildog.workspace.system.application.bo.ApiPermissionCategoryPageBO;
import com.evildog.workspace.system.application.dto.ApiPermissionCategoryDTO;
import com.evildog.workspace.system.application.dto.ApiPermissionCategoryPageDTO;
import com.evildog.workspace.system.application.entity.ApiPermissionCategory;
import com.evildog.workspace.system.application.entity.ApiPermissionCategoryPageDO;
import com.evildog.workspace.system.application.model.ApiPermissionCategoryPageParam;
import com.evildog.workspace.system.application.model.ApiPermissionCategoryParam;
import com.evildog.workspace.system.application.vo.ApiPermissionCategoryPageVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ApiPermissionCategoryConvert {

    ApiPermissionCategoryConvert INSTANCE = Mappers.getMapper(ApiPermissionCategoryConvert.class);

    ApiPermissionCategoryPageDTO convert(ApiPermissionCategoryPageParam apiPermissionCategoryPageParam);

    ApiPermissionCategoryDTO convert(ApiPermissionCategoryParam apiPermissionCategoryParam);

    @Mapping(target = "isDeleted", ignore = true)
    ApiPermissionCategory convert(ApiPermissionCategoryDTO apiPermissionCategoryDTO);

    ApiPermissionCategoryPageDO convert(ApiPermissionCategoryPageDTO apiPermissionCategoryPageDTO);

    @Mappings({})
    PagedResult<ApiPermissionCategoryPageBO> convert(IPage<ApiPermissionCategoryPageDO> page);

    PagedResult<ApiPermissionCategoryPageVO> convert(PagedResult<ApiPermissionCategoryPageBO> page);

    List<ApiPermissionCategoryPageVO> convert(List<ApiPermissionCategoryPageBO> apiPermissionCategoryPageBO);

    List<ApiPermissionCategoryPageBO> convertBOList(List<ApiPermissionCategory> list);
}